//
//  XMServiceInfoViewController.m
//  XMJJ_zmy
//
//  Created by 丁浩 on 2025/7/9.
//

#import "XMServiceInfoViewController.h"
#import "XMServiceInfoView.h"
#import "XMNetwork+login.h"

@interface XMServiceInfoViewController ()

@property (nonatomic, strong) XMServiceInfoView *serviceInfoView;

@end

@implementation XMServiceInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self creatUI];
}

- (void)creatUI {
    [self.view addSubview:self.serviceInfoView];
    [_serviceInfoView setContentWithTitle:_titleStr];
    [self getServiceInfo];
}

- (void)getServiceInfo {
    XMWeakSelf;
    [_Network getServiceInfoWithType:_type
                             success:^(id _Nonnull responseObject) {
        [weakSelf.serviceInfoView setContentWithContent:[responseObject[@"data"] safeStringForKey:@"content"]];
    } failure:^(NSError * _Nonnull error) {
        
    }];
}

- (XMServiceInfoView *)serviceInfoView {
    if (!_serviceInfoView) {
        _serviceInfoView = [[XMServiceInfoView alloc] initWithFrame:self.view.bounds];
    }
    return _serviceInfoView;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
